<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播图</title>
    <style type="text/css">
        body {
            background-color: black;
        }
        .container {

            margin: auto;
            border: 1px solid black;
            width: 888px;
        }
        img {
            width: 888px;
        }
    </style>
    <script>

        onload = function () {

            setInterval(changeImg,1500);
        }

        let i = 0;
        function changeImg() {

            i++;

            let imgObj = document.getElementById("imgId");

            imgObj.src = "./imgg/"+i+".jpg";

            if(i==7){

                i = -1;
            }
        }
    </script>
</head>

<body>
<div class="container">
    <img src="imgg/0.jpg" id="imgId">
</div>

</body>

</html>